<%
class UserAction 'extends CommonAction
	sub newPassword()
		dim data,where,bool:bool=false
		set data = json_decode( POP_MVC.post("_data") )
		set where = D_
		where("id") = data("id")
		where("password") = data("password")
		if ( data("new_password") = data("re_password") ) then
			if( M_("User").db.where( where ).setField("password", md5(data("new_password") ) ) )  then
				bool = true				
			end if
		end if
		if bool Then
			call that.ajaxReturn( array("","密码修改成功",1) )
		else
			call that.ajaxReturn( array("","密码修改失败",0) )
		end if

	end sub
	
	sub newInfo()
		dim data,bool:bool=false
		set data = json_decode( POP_MVC.post("_data") )
		if ( M_("user").db.where( " id = " & data("id") ).setField( data,"" ) ) then bool = true
		if bool Then
			set session("admin") = POP_MVC.dict.merge( session("admin"),data )
			call that.ajaxReturn( array("","信息修改成功",1) )
		else
			call that.ajaxReturn( arrat("","信息修改失败",0) )	
		end if
	end sub
end class
%>